package com.huluobo.sharedemo2;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;

import com.umeng.commonsdk.UMConfigure;
import com.umeng.socialize.ShareAction;
import com.umeng.socialize.media.UMVideo;
import com.umeng.socialize.media.UMWeb;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    public void share(View view) {
        UMWeb web = new UMWeb("https://www.baidu.com/");
        web.setTitle("This is music title");//标题
        //web.setThumb(thumb);//缩略图
        web.setDescription("my description");//描述

        new ShareAction(this)
                .withMedia(web)
                .open();
    }
}